Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse the same DistributedContext more often. #13221

Merged
merged 15 commits into from
Feb 16, 2023
Merged

Conversation

jtkech
Copy link
Member

@jtkech jtkech commented Feb 9, 2023

  • In DistributedShellHostedService to keep tenants in sync we create an isolated context based on the Default shell. One use case is when the Default context is a ShellContext.PlaceHolder and then replaced by a full ShellContext, even if nothing has changed, only because the shell is lazily built on demand, before the isolated shell was always rebuilt, here we prevent this if nothing has changed.

  • Also, in ShellContextFactory when creating a temporary context and scope to retrieve the current descriptor, here we use an empty ShellDescriptor, this because the resolution of IShellDescriptorManager doesn't depend on a feature but on an explicit registration. The result is that when building this temporary context less startup ConfigureServices() are called.

Related to #13169 where we allow to register startup async initializations, so reducing startup executions will also reduce these async initializations.

@sebastienros
Copy link
Member

reducing startup executions

What does it mean, not executing "startup" as many times? Making one execution "faster", what is an "execution" ?

@jtkech
Copy link
Member Author

jtkech commented Feb 9, 2023

@sebastienros

What does it mean, not executing "startup" as many times? Making one execution "faster", what is an "execution" ?

It prevents some shell container building and for some temporary containers reduce the number of features involved, so reduce the number of startup ConfigureServices() that are executed.

Another goal is related to #13169 where we allow to regiter async service initializations (through the startup infrastructure) when a shell container is built, so it would also reduce the number of times these initializations are executed.

@jtkech jtkech changed the title Reduce Startup Executions Reuse the same DistributedContext more often. Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants